<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>document.getElementById</title>
</head>

<body>
    <div id="hug">胡歌</div>
    <script>
        // get 获取 element 元素 by 通过 id名
        // 返回的是对象类型
        // document.getElementById('id名')
        var hug = document.getElementById('hug');
        console.log(hug);
        console.log(typeof hug);
        // 打印返回的元素对象
        console.dir(hug);
    </script>
</body>

</html>